Skip to content

Refactor CommandContributionItemParameter initialization to use supported constructor API#4068

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
deepika-u:illegal_reference
Jun 8, 2026
Merged

Refactor CommandContributionItemParameter initialization to use supported constructor API#4068
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
deepika-u:illegal_reference

Conversation

@deepika-u
Copy link
Copy Markdown
Contributor

@deepika-u deepika-u commented Jun 8, 2026

Summary
Updated the WorkbenchActionBuilder#getItem(...) implementation to replace usage of the deprecated/internal CommandContributionItemParameter constructor with the currently supported constructor pattern.

Changes
Replaced the constructor invocation that accepted multiple UI-related parameters (icon, disabledIcon, label, tooltip, etc.).

Switched to using the supported constructor:

new CommandContributionItemParameter(
getWindow(),
actionId,
commandId,
CommandContributionItem.STYLE_PUSH
);
Populated UI attributes (icon, disabledIcon, label, and tooltip) through the parameter object's fields after construction.
Preserved existing functionality and behavior of the contributed command item.

Reason for Change
The previous implementation triggered an API tooling error:
"WorkbenchActionBuilder illegally references constructor CommandContributionItemParameter(IServiceLocator, String, String, Map, ImageDescriptor, ImageDescriptor, ImageDescriptor, String, String, String, int, String, boolean)"

The existing implementation triggered an Eclipse API tooling error because of the constructor used to create CommandContributionItemParameter. This update adopts a constructor pattern that complies with API tooling validation and initializes presentation-related properties separately. The resulting command contribution behaves the same as before while eliminating the validation issue.

Impact

  • No functional changes.
  • Resolves API tooling/build validation issues.
  • Improves compatibility with newer Eclipse platform versions and supported API guidelines.

Created this as a separate change as suggested via #4061 (review)

@deepika-u
Copy link
Copy Markdown
Contributor Author

@HeikoKlare
When you get some time, can you take a look at this please?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Test Results

   861 files  ±0     861 suites  ±0   49m 1s ⏱️ - 3m 33s
 8 034 tests ±0   7 791 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 541 runs  ±0  19 886 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 10777cc. ± Comparison against base commit a745737.

@HeikoKlare
Copy link
Copy Markdown
Contributor

One less warning. Thank you!

image

@HeikoKlare HeikoKlare merged commit ae3df73 into eclipse-platform:master Jun 8, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants